varying vec3 vColor;
varying float vImgIndex;
varying float vAScale;

uniform sampler2D uTexture1;
uniform sampler2D uTexture2;
uniform sampler2D uTexture3;

void main() {
    //渐变方块点
    //gl_PointCoord类似于UV（y轴朝下）
    //gl_FragColor = vec4(gl_PointCoord, 0.0, 1.0);

    //渐变圆点
    // float strength = distance(gl_PointCoord, vec2(0.5));
    // gl_FragColor = vec4(strength, strength, strength, 1);

    //白色圆点
    // float strength = 1.0 - distance(gl_PointCoord, vec2(0.5));
    // strength = step(0.5, strength);
    // gl_FragColor = vec4(strength, strength, strength, 1);

    //朦胧圆点
    // float strength = distance(gl_PointCoord, vec2(0.5));
    // strength = strength * 2.0;
    // strength = 1.0 - strength;
    // gl_FragColor = vec4(strength, strength, strength, 1);

    vec4 textureColor;
    if(vImgIndex == 0.0) {
        textureColor = texture2D(uTexture1, gl_PointCoord);
    } else if(vImgIndex == 1.0) {
        textureColor = texture2D(uTexture2, gl_PointCoord);
    } else if(vImgIndex == 2.0) {
        textureColor = texture2D(uTexture3, gl_PointCoord);
    }
    //依据角度，使用不同纹理贴图
    gl_FragColor = vec4(vColor, textureColor.g);
}